home *** CD-ROM | disk | FTP | other *** search
/ Sound Fx / Sound Fx.iso / Software / UNZIPED / MPW181-5 / _SETUP.1 / obuffer.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-21  |  2.6 KB  |  102 lines

  1. /* obuffer.h
  2.  
  3.    Declarations for output buffer, includes operating system
  4.    implementation of the virtual Obuffer. Optional routines
  5.    enabling seeks and stops add by Jeff Tsay. */
  6.  
  7. /*
  8.  *  @(#) obuffer.h 1.8, last edit: 6/15/94 16:51:56
  9.  *  @(#) Copyright (C) 1993, 1994 Tobias Bading (bading@cs.tu-berlin.de)
  10.  *  @(#) Berlin University of Technology
  11.  *
  12.  *  Idea and first implementation for u-law output with fast downsampling by
  13.  *  Jim Boucher (jboucher@flash.bu.edu)
  14.  *
  15.  *  LinuxObuffer class written by
  16.  *  Louis P. Kruger (lpkruger@phoenix.princeton.edu)
  17.  *
  18.  *  This program is free software; you can redistribute it and/or modify
  19.  *  it under the terms of the GNU General Public License as published by
  20.  *  the Free Software Foundation; either version 2 of the License, or
  21.  *  (at your option) any later version.
  22.  *
  23.  *  This program is distributed in the hope that it will be useful,
  24.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  25.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  26.  *  GNU General Public License for more details.
  27.  *
  28.  *  You should have received a copy of the GNU General Public License
  29.  *  along with this program; if not, write to the Free Software
  30.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  31.  */
  32.  
  33. #ifndef OBUFFER_H
  34. #define OBUFFER_H
  35.  
  36. #include "all.h"
  37. #include "args.h"
  38.  
  39. static const uint32 OBUFFERSIZE = 2 * 1152;    // max. 2 * 1152 samples per frame
  40. static const uint32 MAXCHANNELS = 2;        // max. number of channels
  41.  
  42. // Abstract base class for audio output classes:
  43. class Obuffer
  44. {
  45. public:
  46.  
  47.   virtual     ~Obuffer() {}        // dummy
  48.  
  49.   virtual void append (uint32 channel, int16 value) = 0;
  50.              // this function takes a 16 Bit PCM sample
  51.   virtual void write_buffer(int32 fd) = 0;
  52.              // this function should write the samples to the filedescriptor
  53.              // or directly to the audio hardware
  54.  
  55. #ifdef SEEK_STOP
  56.   virtual void clear_buffer(void) = 0;
  57.              // Clears all data in the buffer (for seeking)
  58.  
  59.   virtual void set_stop_flag(void) = 0;
  60.              // Notify the buffer that the user has stopped the stream
  61. #endif // SEEK_STOP
  62.  
  63. };
  64.  
  65. Obuffer *create_obuffer(MPEG_Args *maplay_args);
  66.  
  67. #include "fileobuf.h"
  68.  
  69. #ifdef Indigo
  70. #include "indigo_obuffer.h"
  71. #endif
  72.  
  73. #ifdef SPARC
  74. #include "sparc_obuffer.h"
  75. #endif
  76.  
  77. #ifdef HPUX
  78. #include "hpux_obuffer.h"
  79. #endif
  80.  
  81. #ifdef LINUX
  82. #include "linux_obuffer.h"
  83. #endif
  84.  
  85. #ifdef NeXT
  86. #include "NeXT_obuffer.h"
  87. #endif
  88.  
  89. #ifdef AIX
  90. #include "aix_obuffer.h"
  91. #endif
  92.  
  93. #ifdef __WIN32__
  94. #include "mci_obuf.h"
  95. #endif
  96.  
  97. #ifdef BEOS
  98. #include "beos_obuffer.h"
  99. #endif
  100.  
  101. #endif // OBUFFER_H
  102.